﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

///<summary>
///角色的可操作状态，这个是根据游戏玩法来细节设计的
///</summary>
public struct ChaControlState{
    ///<summary>
    ///是否可以移动坐标
    ///</summary>
    public bool CanMove;

    ///<summary>
    ///是否可以攻击
    /// 当没有装备武器或者非攻击武器时就不能攻击
    ///</summary>
    public bool CanAttack;

    public ChaControlState(bool canMove = true, bool canAttack = true){
        CanMove = canMove;
        CanAttack = canAttack;
    }

    public void Origin(){
        CanMove = true;
        CanAttack = true;
    }

    public static ChaControlState origin = new ChaControlState(true, true);

    ///<summary>
    ///昏迷效果
    ///</summary>
    public static ChaControlState Stun = new ChaControlState(false, false);

    public static ChaControlState operator +(ChaControlState cs1, ChaControlState cs2){
        return new ChaControlState(
            cs1.CanMove & cs2.CanMove,
            cs1.CanAttack & cs2.CanAttack
        );
    }
}